package ltd.latewhale.whalenest.service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import ltd.latewhale.whalenest.mapper.basicMapper;
import ltd.latewhale.whalenest.model.basicDO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class basicService extends ServiceImpl<basicMapper, basicDO> {

    @Autowired
    private basicMapper basicMapper;

    public List<basicDO> getDatas(){

        List<basicDO> datas = basicMapper.selectList(null);

        return datas;
    }

    public Integer deleteData(
            Integer id
    ){
        Integer data = basicMapper.deleteById(id);

        return data;
    }

    public  Integer putData(
            basicDO dto
    ){
        Integer data = basicMapper.updateById(dto);

        return data;
    }

    public Integer postData(
            basicDO dto
    ){
        Integer data = basicMapper.insert(dto);

        return data;
    }
}
